package backingBean;

import java.util.List;
import javax.faces.model.SelectItem;
import model.ProfileType;
import abstractFactory.Factory;

public class BeanProfileType {
	public BeanProfileType(){}

	public List<ProfileType> getProfileTypes(){
		return Factory.getInstance("JPA").createProfileTypeDAO().getAllProfileTypes();
	}

	public SelectItem[] getProfileType(){
		SelectItem[] items = new SelectItem[getProfileTypes().size()];
		for(int i=0; i<getProfileTypes().size();i++ ){
			items[i] = new SelectItem(getProfileTypes().get(i),getProfileTypes().get(i).getName());
		}
		return items;
	}
}